package com.tepth.vehiclemaintenance.mvp.work.search;

import com.tepth.vehiclemaintenance.bean.SearchPartResult;
import com.tepth.vehiclemaintenance.net.ApiModel;
import com.tepth.vehiclemaintenance.net.Network;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
* Created by TMVPHelper on 2017/05/16
*/
public class SearchModel implements SearchContract.Model{

    @Override
    public Observable<ApiModel<SearchPartResult>> searchPart(String authKey, String name) {
        return Network.getApiService().searchPart(authKey, name).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }

    @Override
    public Observable<ApiModel<SearchPartResult>> getCommonComponents(String authKey, int count) {
        return Network.getApiService().getCommonComponent(authKey, count).subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }
}